'''
动态折线图演示示例
'''
#
# import numpy as np
# import matplotlib.pyplot as plt
#
# plt.ion()
# plt.figure(1)
# t_list = []
# result_list = []
# t = 0
#
# while True:
#     if t >= 10 * np.pi:
#         plt.clf()
#         t = 0
#         t_list.clear()
#         result_list.clear()
#     else:
#         t += np.pi / 4
#         t_list.append(t)
#         result_list.append(np.sin(t))
#         plt.plot(t_list, result_list, c='k', ls='--', marker='.', mec='m', mfc='w')  ## 保存历史数据
#         # plt.plot(t, np.sin(t), 'o')
#         plt.pause(0.1)


# 静态图
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
zhfont1 = matplotlib.font_manager.FontProperties(fname='SourceHanSansSC-Bold.otf')
x = np.arange(1, 11)
y = x * 2 + 5
plt.title("每小时比特币价格的变价", fontproperties=zhfont1)
# fontproperties 设置中文显示， fontsize 设置字体大小
plt.xlabel("x 轴", fontproperties=zhfont1)
plt.ylabel("y 轴", fontproperties=zhfont1)
plt.plot(x, y)
plt.show()

